<!--
 * @Author: your name
 * @Date: 2021-10-26 20:52:46
 * @LastEditTime: 2021-10-26 21:15:09
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \bigdate\src\views\admin\componentsPage\verify.vue
-->
<template>
    <div class="verify">
        <div class="verify_con">
            <Card>
                <div class="card_cell">滑动验证码</div>
                <div class="card_cell">
                    <V-verify ref="Verify" @success="onSuccess"></V-verify>
                </div>
                <div class="card_cell">
                    <Button type="primary" block @click="onReload">还原</Button>
                </div>
            </Card>
        </div>
    </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
import { Card, Button } from 'ant-design-vue'
import VVerify from '@/components/verifyComp/index.vue'
import { useMassage } from '@/ntils/hooks'

export default defineComponent({
    name: 'Varify',
    components: {
        Card,
        VVerify,
        Button,
    },
    setup() {
        let { createMessage } = useMassage()
        const Verify = ref()
        const onSuccess = (e) => {
            createMessage.success('验证成功！')
        }
        const onReload = () => {
            Verify.value?.reload()
        }
        return {
            onSuccess,
            onReload,
            Verify,
        }
    },
})
</script>

<style lang="less" scoped>
.verify {
  width: 100%;
  &_con {
    width: 300px;
    margin: 5rem auto;
    .card_cell {
      margin: 3rem 0;
      text-align: center;
    }
  }
}
</style>
